<?php
/*
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
*/

    session_start();
    include ('includes/includes.php');
    require_once('includes/inc.csvcreation.php');   


    $nivell = $_GET['nivell'];
    $pregunta = $_GET['pregunta'];  
     
    echo "GENERADOR d'EXCEL sociograma " . $nivell . "<br><br>";
    
    genera_excel_pregunta($nivell,$pregunta);
     
    $nomtaula = "`sociograma".$nivell."pregunta_".$pregunta."`";  
    $nomfitxer = "201112-sociograma".$nivell."preg_".$pregunta.""; 
     
    $csvcreate = new CSVCreation();
    $csvcreate->path = 'c:\wamp\www\sociogrames\\';

    $csvcreate->createcsv($nomtaula,$nomfitxer);
    
    echo "<a href='http://tecnoserver/sociogrames/".$nomfitxer.".csv'>Fitxer cvs generat</a>";

?>
